<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('微信账号绑定')" />
</head>
<body>
     <div>
		<div class="row">
			<div class="col-xs-12 " style="padding-top: 10%">
					<div class="col-xs-4 select-list col-xs-offset-4">
						<span>手机号：<input type="text" name="tel"/></span>
						<span><button class="" id="bind">绑定</button></span>
						<span id="sray"></span>
						
						
						
					</div>
					<div class="col-xs-4"/>
					<input type="hidden" name="openid" th:value="${openid}"/>
			</div>
		</div>
	</div>

    <div th:include="include :: footer"></div>
    
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script type="text/javascript">
    	$("#bind").click(function(){
    		var tel = $("input[name='tel']").val();
        	var openid = $("input[name='openid']").val();
        	var prefix = ctx + "system/wxUser";
        	$.ajax({
				//绑定微信号和手机号
        		type: "POST",
        		data: {
        			tel:tel,
        			openid:openid
        		},
        		dateType: "json",
        		url: prefix + "/bind",
    	        success: function(result) {
    	        	if(result.code == 0){
    	        		layer.open({
    	        			  title: '提示',
    	        			  content: result.msg
    	        			});     
    	        			  
    	        	}else{
    	        		layer.open({
  	        			  title: '提示',
  	        			  content: result.msg
  	        			});
    	        	}
    	        	//$.operate.ajaxSuccess(result);
    	        }
        	})
    	})
        
        
    </script>
</body>
</html>